/**
 * 登录 把用户名存在localStorage中
 */
export function loginIn(token,userName) {
  // console.log(userName)
  localStorage.setItem('token',token)
  localStorage.setItem('userName',userName)
}

/**
 * 通过存储的内容判断用户是否登录
 */
export function isLogined() {
  if (localStorage.getItem('token','userName')) {
    return true
  } else {
    return false
  }
}

/**
 * 清除本地存储
 */
export function logOut() {
  localStorage.removeItem('token')
  localStorage.removeItem('userName')
}